<% include("/common/splitPage.html"){} %>

<form id="splitPage" class="form-horizontal" action="${cxt!}/jf/sysLog" method="POST">
	
	<div>
		<ul class="breadcrumb">
			<li><a href="#" onclick="ajaxContent('/jf/index/content');">主页</a> <span class="divider">/</span></li>
			<li>
				<a href="#">分组管理</a>
			</li>
		</ul>
	</div>
	
	<div class="row-fluid sortable">
		<div class="box span12">
			<div class="box-header well" data-original-title>
				<h2><i class="icon-edit"></i> 日志查询</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-down"></i></a>
					<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
				</div>
			</div>
			<div class="box-content" style="display: none;">
				<fieldset>
				  	<div class="control-group">
						<label class="control-label" for="focusedInput">功能名称</label>
						<div class="controls">
					  		<input class="input-xlarge focused" type="text" name="_query.names" value='${escapeXml(paramMap["_query.names"])}' maxlength="20" >
						</div>
				  	</div>
				  	
				  	<div class="control-group">
						<label class="control-label" for="focusedInput">用户账号</label>
						<div class="controls">
					  		<input class="input-xlarge focused" type="text" name="_query.username" value='${escapeXml(paramMap["_query.username"])}' maxlength="20" >
						</div>
				  	</div>
				  	
				  	<div class="control-group">
						<label class="control-label" for="focusedInput">IP</label>
						<div class="controls">
					  		<input class="input-xlarge focused" type="text" name="_query.ips" value='${escapeXml(paramMap["_query.ips"])}' maxlength="20" >
						</div>
				  	</div>
				  	
				  	<div class="control-group">
						<label class="control-label" for="focusedInput">状态</label>
						<div class="controls">
					  		<select name="_query.status" class="combox">
								<option></option>
								<option value="1" ${paramMap["_query.status"]! == "1" ? "selected='selected'":"" }>成功</option>
								<option value="0" ${paramMap["_query.status"]! == "0" ? "selected='selected'":"" }>失败</option>
							</select>
						</div>
				  	</div>
				  	
				  	<div class="form-actions">
						<button type="button" class="btn btn-primary" onclick='ajaxForm("splitPage");'>查询</button>
						<button type="reset" class="btn">清除</button>
				  	</div>
				</fieldset>
			</div>
		</div><!--/span-->
	</div><!--/row-->
	
	<div class="row-fluid sortable">
		<div class="box span12">
			
			<div class="box-header well" data-original-title>
				<h2><i class="icon-user"></i> 日志列表</h2>
				<div class="box-icon">
					<a href="#" class="btn btn-minimize btn-round"><i class="icon-chevron-up"></i></a> 
					<a href="#" class="btn btn-close btn-round"><i class="icon-remove"></i></a>
				</div>
			</div>
			
			<div class="box-content">
				<table class="table table-striped table-bordered bootstrap-datatable ">
					<thead>
						<tr>
							<th onclick="orderbyFun('onames')">
								功能${orderBy("onames")}
							</th>
							<th width="100" onclick="orderbyFun('u.username')">
								用户${orderBy("u.username")}
							</th>
							<th width="35" onclick="orderbyFun('status')">
								状态${orderBy("status")}
							</th>
							<th width="100" onclick="orderbyFun('ips')">
								IP${orderBy("ips")}
							</th>
							<th width="150" onclick="orderbyFun('startDate')">
								时间${orderBy("startDate")}
							</th>
							<th width="45" onclick="orderbyFun('actionHaoShi')">
								控制器${orderBy("actionHaoShi")}
							</th>
							<th width="40" onclick="orderbyFun('viewHaoShi')">
								视图${orderBy("viewHaoShi")}
							</th>
							<th width="45" onclick="orderbyFun('haoShi')">
								总耗时${orderBy("haoShi")}
							</th>
							<th width="140">操作</th>
						</tr>
					</thead>
					<tbody>
						<%
							var view = hasPrivilegeUrl("/jf/sysLog/view");
							var delete = hasPrivilegeUrl("/jf/sysLog/delete");
						%>
						<% for(sysLog in splitPage.page.list){ %>
							<tr>
								<td align="center">${sysLog["onames"] }：${sysLog.ourl }</td>
								<td align="center">${sysLog["username"] }</td>
								<td align="center">
									<% if(sysLog["status"] == "1"){%>
										<span class="label label-success">成功</span>
									<% } else if(sysLog["status"] == "0"){%>
										<span class="label label-warning">失败</span>
									<% } %>
								</td>
								<td align="center">${sysLog["ips"] }</td>
								<td align="center">
									${sysLog.startdate !, dateFormat="yyyy-MM-dd HH:mm:ss:SSS"}
								</td>
								<td align="center">${sysLog["actionhaoshi"] }</td>
								<td align="center">${sysLog["viewhaoshi"] }</td>
								<td align="center">
									<% if(sysLog["haoshi"] > 1000){%>
										<span class="label label-warning">${sysLog["haoshi"] }</span>
									<% } else {%>
										<span class="label label-success">${sysLog["haoshi"] }</span>
									<% } %>	
								</td>
								<td class="center">
									<% if(view == true){ %>
										<a class="btn btn-success" href="#" onclick="ajaxContent('/jf/sysLog/view/${sysLog.ids!}');"> <i class="icon-zoom-in icon-white"></i> 查看</a> 
									<% } %>
									<% if(delete == true){ %>
										<a class="btn btn-danger" href="#" onclick="ajaxContent('/jf/sysLog/delete/${sysLog.ids!}');"> <i class="icon-trash icon-white"></i> 删除</a>
									<% } %>
								</td>
							</tr>
						<% } %>
					</tbody>
				</table>
				<div id="splitPageDiv" class="pagination pagination-centered"></div>
			</div>
			
		</div>
		<!--/span-->
	
	</div>
	<!--/row-->

</form>